package com.designpattern.creatorpattern.factorypattern.factory_method;

/**
 * @author Administration
 * @date 2021/10/13 - 11:11 - 星期三
 * @project lambda
 * @package com.designpattern.factorypattern.factory_method
 * @by 晨
 */
public class test {
    public static void main(String[] args) {
        //创建咖啡店对象
        CoffeeStore store = new CoffeeStore();

        CoffeeFactory factory = new LatteCoffeeFactory();
        store.setFactory(factory);

        //点咖啡
        Coffee coffee = store.orderCoffee();

        System.out.println(coffee.getName());
    }
}
